import { UploadUserFile } from 'element-plus'

// 库存管理
export namespace Inventory {
  export interface ResCustomList {
    id: number | string
    customeCode: string
    name: string
    alias: string
    contact: string
    mobile: string
    address: string
    status: number
    commTypeId: number
    label?: string
    value?: number
  }
  export interface CategoryList {
    children: Array<CategoryList>
    corpId: number
    createTime: string
    id: number
    imageUrl: any
    isDelete: false
    isShow: true
    name: string
    parentId: number
    sort: number
    storeId: number
    typeId: number
    typeName: any
  }
  export interface ResWaresCategoryList {
    id: string | number
    name: string
    typeId: string | number
    imageUrl: string
  }
  export interface ResWaresBrandList {
    id: string | number
    name: string
    logoImageUrl: string | number
    isShow: number
  }
  export interface ResGoodsList {
    barcode?: string
    brandName?: any
    categoryName?: string
    convert?: number
    corpId?: number
    createTime?: string
    id?: number
    image?: string
    isDefalut?: boolean
    isGoods?: number
    isMarketable?: boolean
    mallPrice?: number
    name?: string
    number?: any
    plu?: any
    posPrice?: number
    prodcutId?: number
    prodcutPrciceId?: number
    productName?: string
    purPrice?: number
    rmoPrice?: number
    specName?: string
    storeId?: number
    unitName?: string
    vipPrice?: number
    productsId?: number
    goodsName?: string
    goodsId?: number
    products?: any
    quantity?: number
    price?: number
    amount?: number | string
    taxRate?: number
    isGift?: boolean
    giftQuantity?: number
    houseId?: number
    realQuantity?: number
    unitBasis?: any
    sn?: string
    covert?: any
    lastInvoicePrice?: number
    stockUnit?: string
    stockCount?: number
    defaultUnit?: string
    basePrice?: number
    basicQuantity?: number
    waitDeliveryQuantity?: number
    deliveryQuantity?: number
    totalDeliveryQuantity?: number
    totalReturnQuantity?: number
    waitGiftDeliveryQuantity?: number
    waitGiftReturnQuantity?: number // 可退换礼品数量
    waitReturnQuantity?: number // 可退换数量
    stockPrice?: number
    remark?: string
    newSalePrice?: number
    oldSalePrice?: number
  }
  export interface ResSupplierList {
    id: string | number
    name: string
    supplierCode: string
    helpCode: string
    businessType: number
    businessTypeName: string
    commissionRate: number
    regionId: number
    regionName: string
    settleType: number
    settleTypeName: string
    checkOutCycle: number
    monCheckCyclse: string
    contact: string
    mobile: string
    contactAddress: string
    bank: string
    bankAccount: string
    businessLicense: string
    taxCode: string
  }
  // 计划数据列表
  export interface ResStockPlanList {
    id: string | number
    name: string
    supplierCode: string
    helpCode: string
    businessType: number
    businessTypeName: string
    commissionRate: number
    regionId: number
    regionName: string
    settleType: number
    settleTypeName: string
    checkOutCycle: number
    monCheckCyclse: string
    contact: string
    mobile: string
    contactAddress: string
    bank: string
    bankAccount: string
    businessLicense: string
    taxCode: string
  }
  export interface ResStockRealSheetList {
    orderId: number
    corpId: number
    storeId: number
    orderNo: string
    range: number
    planOrderId: number
    checkerId: number
    checkFlag: boolean
    checkTime: string
    createTime: string
    updateTime: string
    remark: 'lsh66666'
    sysUserId: number
    dateType: number
    inventorydetailList: CheckGoodsList[]
  }
  // 损益单列表
  export interface ResStockIncomeList {
    orderId: number
    corpId: number
    storeId: number
    orderNo: string
    range: number
    planOrderId: number
    checkerId: number
    checkFlag: boolean
    checkTime: string
    createTime: string
    updateTime: string
    remark: 'lsh66666'
    sysUserId: number
    dateType: number
    inventorydetailList: CheckGoodsList[]
  }
  export interface ResStockStatementList {
    // 库存流水
    id: number
    storeId: number
    corpId: number
    productId: number
    goodsId: number
    price: number
    balancePrice: number
    amount: number
    balanceAmount: number
    quantity: number
    balanceQuantity: number
    convert?: unknown
    sourceId?: unknown
    sourceNo?: unknown
    sourceDetailId?: unknown
    houseId: number
    type: number
    createTime: string
    barcode: string
    goodsName?: unknown
    unitName: string
    productName: string
    typeName: string
    houseName: string
    categoryName: string
  }
  export interface ResSupplierRegionList {
    id: number | string
    name: string
    areaCode: string
    totalSupplier: number
  }
  export interface ResPurchaseList {
    id: number | string
    orderNo: string
    orderDate: string
    supplierId: number
    deliveryDate: string
    deliveryStatus: number
    remark: string
    checkFlag: number
    orderAmount: number
    supplierName: string
  }
  export interface ResStockOutList {
    id: number | string
    trackingNo: string
    LogisticsId: string
    orderNo: string
    customerId: string
    contacts: string
    mobile: string
    address: string
    checkFlag: boolean
    outTime: string
    createTime: string
    LogisticsName: string
    orderAmount: number
  }
  export interface ResGoodTotalList {
    id: string | number
    goodsName: string
    categoryName: string
    unitName: string
    bn: string
    minQuantity: number
    maxQuantity: number
    price: number
    quantity: number
  }
  export interface ResStorehouseList {
    id: string | number
    name: string
    code: string
    isDefault: boolean
  }
  export interface StockCheckoutList {
    id: string | number
    orderNo: string
    houseName: string
    date: string
    barcode: string
    goodsName: string
    categoryName: string
    unitName: string
    quantity: number
    amount: number
    orderId: number
    documentType: number
  }
  // 商品规格信息子类型
  export interface Product {
    barcode: string
    convert: number
    mallPrice: number
    onLine: boolean
    posPrice: number
    purPrice: number
    rmoPrice: number
    spesDesc: string
    unitName: string
    vip1Price: number
    vip2Price: number
    vip3Price: number
    vipPrice: number
  }
  // 商品规格详情子类型
  interface GoodsSpec {
    sn: string // 商品代码
    barcode: string // 条码
    spesDesc: string // 规格型号
    unitName: string // 单位名称
    convert: number // 换算率
    posPrice: number // 零售价
    purPrice: number // 进货价
    rmoPrice: number // 配送价
    vipPrice: number // 会员价
    vip1Price: number // 会员价1
    vip2Price: number // 会员价2
    maxPrice: number // 最高售价
    minPrice: number // 最低售价
    minQuantity: number // 库存下限
    maxQuantity: number // 库存上限
  }
  export interface GoodsDetail {
    // 商品详情主类型
    id: number
    saleType: number // 销售类型
    name: string // 商品名称
    images: UploadUserFile[] // 商品图片
    pinYin: string // 速记码
    goodsCategoryId: number | null // 商品分类ID
    brandId: number | null // 品牌ID
    commissionType: number // 销售提成类型
    commissionValue: number // 提成比例/金额
    effectiveDays: string // 保质期
    isStock: boolean // 是否库存管理
    operationMode: number // 经营模式
    supplierId: number | null // 主供应商ID
    producer: string // 仓储位置
    pointValue: number // 积分值
    pointType: number // 积分类型
    remark: string // 备注
    isMarketable: boolean // 商品状态(在售、停售)
    spesDesc: string // 规格型号
    products: GoodsSpec[] // 商品规格列表
    intro: string
  }
  export interface BranchList {
    corpId: number
    createTime: string
    id: number
    isShow: true
    logoImageUrl: string
    name: string
    sort: number
    storeId: number
  }
  export interface SupplierList {
    corpId: number
    createTime: string
    id: number
    isShow: true
    logoImageUrl: string
    name: string
    sort: number
    storeId: number
  }
  export interface ResGoodsSpecificationsList {
    id: number
    name: string
    refGoodsCount: number
  }
  export interface CheckGoodsList {
    barcode: string // 商品条码（如 "JLY001"）
    categoryName: string // 商品分类名称（如 "花生油"）
    costAmount: number // 成本总金额（成本单价 * 数量，如 880）
    costPrice: number // 商品成本单价（如 88）
    goodsId: number // 商品ID（与 id 字段值一致，可能为关联标识）
    id: number // 主键ID（唯一标识，如 494408965840965）
    name: string // 商品名称（如 "金龙鱼花生油"）
    planQuantity: number // 计划数量（如 10）
    price: number // 商品售价（如 88）
    productName: string // 产品名称（与商品名称一致，可能为标准化命名）
    productsId: number // 产品关联ID（如 494408965840966）
    profitLossAmount: string // 盈亏金额（当前为空字符串，存为 string 类型适配）
    profitLossQuantity: string // 盈亏数量（当前为空字符串，存为 string 类型适配）
    realQuantity: number // 实际库存数量（如 0）
    unitName: string // 商品单位（如 "瓶"）
    prodcutId?: number
    goodsName?: string
    purPrice?: number
  }
}
